<?php
	include('config.php');
	if (mysql_query("DROP DATABASE IF EXISTS  bugbase"))
	{
		echo "<br>Old database deleted";
	}
	if (mysql_query("CREATE DATABASE IF NOT EXISTS bugbase"))
	{
		echo "<br>new database created";
	}
	mysql_select_db("bugbase");
	//create table postion	
	$sql_create_position_dbo = "
									CREATE TABLE IF NOT EXISTS position
									(
										position_id 		int not null auto_increment,
										position_name 		varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										PRIMARY KEY(position_id)
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci								
								";
	if(mysql_query($sql_create_position_dbo))
	{
		echo "<br/>Table position created";
		//insert data
		$sql_insert = "INSERT INTO position (position_id, position_name) VALUES 
																	(1,'Producer'),
																	(2,'Tester'),
																	(3,'LeaderTester'),
																	(4,'Artist'),
																	(5,'LeaderArtist'),
																	(6,'Design'),
																	(7,'LeaderDesign'),
																	(9,'Dev'),
																	(10,'LeaderDev')
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert position completed";
		}
		else
		{
			echo "<br/>Error Insert position: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error() . "<br/>";
	}
	
	//create table userkey
	$sql_create_userkey_dbo = "
									CREATE TABLE IF NOT EXISTS userkey
									(
										key_id 		int not null auto_increment,
										key_name 	varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										PRIMARY KEY(key_id)
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci								
								";
	if(mysql_query($sql_create_userkey_dbo))
	{
		echo "<br/>Table userkey created";
		//insert data
		$sql_insert = "INSERT INTO userkey (key_id, key_name) VALUES 
																	(1,'Admin'),
																	(2,'Manager')
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert userkey completed";
		}
		else
		{
			echo "<br/>Error Insert userkey: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error();
	}
	
	//create table user_info
	$sql_create_user_info_dbo = "
									CREATE TABLE IF NOT EXISTS user_info
									(
										user_id 		int not null auto_increment,
										username 		varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										email 			varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										loginname 		varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										password 		varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										avatarURL 		varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										position_id 	int not null,
										key_id 			int not null,
										PRIMARY KEY(user_id),
										INDEX(position_id),
										FOREIGN KEY (position_id) REFERENCES position (position_id) ON UPDATE CASCADE ON DELETE CASCADE,
										INDEX(key_id),
										FOREIGN KEY (key_id) REFERENCES userkey (key_id) ON UPDATE CASCADE ON DELETE CASCADE	
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci						
								";
	if(mysql_query($sql_create_user_info_dbo))
	{
		echo "<br/>Table user_info created";
		//insert data
		$sql_insert = "INSERT INTO user_info (user_id, username, email, loginname, password, avatarURL, position_id, key_id) VALUES 
																	(1,'Huynh Kim Luong','luong.huynh@pine-entertainment.com','luonghuynh90','nguyet','../images/user/luonghuynh90.jpg',1,1),
																	(2,'admin','luong.huynh@pine-entertainment.com','admin','123','../images/user/luonghuynh90.jpg',1,1)
																															
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert user_info completed";
		}
		else
		{
			echo "<br/>Error Insert userkey: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error();
	}
	
	//create table project
	$sql_create_project_dbo = "
									CREATE TABLE IF NOT EXISTS project
									(
										project_id 		int not null auto_increment,
										project_name	varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										deadline		int	 not null,
										PRIMARY KEY(project_id)
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci						
								";
	if(mysql_query($sql_create_project_dbo))
	{
		echo "<br/>Table project created";
		//insert data
		$sql_insert = "INSERT INTO project (project_id, project_name, deadline) VALUES 
																	(1,'Pocket Army',UNIX_TIMESTAMP ('2012-01-30 7:0:0')),
																	(2,'Pocket Photo Quiz',UNIX_TIMESTAMP ('2012-03-30 7:0:0')),
																	(3,'Pocket Avenger',UNIX_TIMESTAMP ('2012-05-30 7:0:0')),
																	(4,'Pocket Dragon',UNIX_TIMESTAMP ('2012-07-30 7:0:0')),
																	(5,'Pocket Candy',UNIX_TIMESTAMP ('2012-09-30 7:0:0'))
																															
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert project completed";
		}
		else
		{
			echo "<br/>Error Insert project: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error();
	}
	
	//create table device
	$sql_create_device_dbo = "
									CREATE TABLE IF NOT EXISTS device
									(
										device_id 		int not null auto_increment,
										device_name		varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										PRIMARY KEY(device_id)
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci						
								";
	if(mysql_query($sql_create_device_dbo))
	{
		echo "<br/>Table device created";
		//insert data
		$sql_insert = "INSERT INTO device (device_id, device_name) VALUES 
																	(1,'Ipad'),
																	(2,'Iphone4'),
																	(3,'Iphone5')																																													
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert device completed";
		}
		else
		{
			echo "<br/>Error Insert device: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error();
	}
	
	//create table severity
	$sql_create_severity_dbo = "
									CREATE TABLE IF NOT EXISTS severity
									(
										severity_id 		int not null auto_increment,
										severity_name		varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										severity_color		varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										PRIMARY KEY(severity_id)
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci						
								";
	if(mysql_query($sql_create_severity_dbo))
	{
		echo "<br/>Table severity created";
		//insert data
		$sql_insert = "INSERT INTO severity (severity_id, severity_name,severity_color) VALUES 
																	(1,'Feature','rgb(255,42,42)'),
																	(2,'Major','rgb(255,144,0)'),
																	(3,'Medium','rgb(255,255,0)'),
																	(4,'Normal','rgb(78,231,48)'),
																	(5,'Suggestion','rgb(68,156,255)'),
																	(6,'Customer','rgb(161,94,223)')
																																												
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert severity completed";
		}
		else
		{
			echo "<br/>Error Insert severity: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error();
	}
	
	//create table category
	$sql_create_category_dbo = "
									CREATE TABLE IF NOT EXISTS category
									(
										category_id 		int not null auto_increment,
										category_name		varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										PRIMARY KEY(category_id)
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci						
								";
	if(mysql_query($sql_create_category_dbo))
	{
		echo "<br/>Table category created";
		//insert data
		$sql_insert = "INSERT INTO category (category_id, category_name) VALUES 
																	(1,'Network'),
																	(2,'Graphic'),
																	(3,'LogicCode')
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert category completed";
		}
		else
		{
			echo "<br/>Error Insert category: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error();
	}
	
	//create table techrepro
	$sql_create_techrepro_dbo = "
									CREATE TABLE IF NOT EXISTS techrepro
									(
										techrepro_id 		int not null auto_increment,
										techrepro_name		varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										PRIMARY KEY(techrepro_id)
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci						
								";
	if(mysql_query($sql_create_techrepro_dbo))
	{
		echo "<br/>Table techrepro created";
		//insert data
		$sql_insert = "INSERT INTO techrepro (techrepro_id, techrepro_name) VALUES 
																	(1,'10%'),
																	(2,'20%'),
																	(3,'30%'),
																	(4,'40%'),
																	(5,'50%'),
																	(6,'60%'),																	
																	(7,'70%'),
																	(8,'80%'),
																	(9,'90%'),
																	(10,'100%')
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert techrepro completed";
		}
		else
		{
			echo "<br/>Error Insert techrepro: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error();
	}
	
	//create table status
	$sql_create_status_dbo = "
									CREATE TABLE IF NOT EXISTS status
									(
										status_id 		int not null auto_increment,
										status_name		varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										status_icon		varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										PRIMARY KEY(status_id)
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci						
								";
	if(mysql_query($sql_create_status_dbo))
	{
		echo "<br/>Table status created";
		//insert data
		$sql_insert = "INSERT INTO status (status_id, status_name,status_icon) VALUES 
																	(1,'Open','../images/icon_open.png'),
																	(2,'Fixed','../images/icon_fixed.png'),
																	(3,'Comfirmed','../images/icon_confirm.png'),
																	(4,'Closed','../images/icon_close.png')
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert status completed";
		}
		else
		{
			echo "<br/>Error Insert status: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error();
	}
	
	//create table bug
	$sql_create_bug_dbo = "
									CREATE TABLE IF NOT EXISTS bug
									(
										bug_id 			int not null auto_increment,
										title			varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										description		varchar(2550) CHARACTER SET utf8 COLLATE utf8_unicode_ci not null,
										severity_id		int not null,
										category_id		int not null,
										techrepro_id	int not null,
										device_id		int not null,
										status_id		int not null,
										project_id		int not null,
										PRIMARY KEY(bug_id),
										INDEX(severity_id),
										FOREIGN KEY (severity_id) REFERENCES severity (severity_id) ON UPDATE CASCADE ON DELETE CASCADE,
										INDEX(category_id),
										FOREIGN KEY (category_id) REFERENCES category (category_id) ON UPDATE CASCADE ON DELETE CASCADE,
										INDEX(techrepro_id),
										FOREIGN KEY (techrepro_id) REFERENCES techrepro (techrepro_id) ON UPDATE CASCADE ON DELETE CASCADE,
										INDEX(device_id),
										FOREIGN KEY (device_id) REFERENCES device (device_id) ON UPDATE CASCADE ON DELETE CASCADE,
										INDEX(status_id),
										FOREIGN KEY (status_id) REFERENCES status (status_id) ON UPDATE CASCADE ON DELETE CASCADE,
										INDEX(project_id),
										FOREIGN KEY (project_id) REFERENCES project (project_id) ON UPDATE CASCADE ON DELETE CASCADE
										
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci						
								";
	if(mysql_query($sql_create_bug_dbo))
	{
		echo "<br/>Table bug created";
		//insert data
		$sql_insert = "INSERT INTO bug (bug_id, title,description,severity_id,category_id,techrepro_id,device_id,status_id,project_id) VALUES 
																	(1,'Open','test1',1,1,1,1,1,1),
																	(2,'Open','test2',1,1,2,1,2,2),
																	(3,'Open','test3',3,2,3,1,2,3),
																	(4,'Open','test4',3,2,4,1,3,4),
																	(5,'Open','test5',2,3,5,1,3,5),
																	(6,'Open','test6',2,3,6,1,3,1),
																	(7,'Open','test7',1,1,7,1,1,2),
																	(8,'Open','test8',1,1,8,1,1,3),
																	(9,'Open','test9',3,2,9,1,1,4),
																	(10,'Open','test10',3,2,10,1,2,5),
																	(11,'Open','test11',2,3,1,1,4,1),
																	(12,'Open','test12',2,3,2,1,4,2),
																	(13,'Open','test13',1,1,3,1,1,3),
																	(14,'Open','test14',3,1,4,1,3,4),
																	(15,'Open','test15',2,2,5,1,4,5)
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert bug completed";
		}
		else
		{
			echo "<br/>Error Insert bug: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error();
	}
	
	//create table bug_device
	/*
	$sql_create_bug_device_dbo = "
									CREATE TABLE IF NOT EXISTS bug_device
									(
										bug_device_id 			int not null auto_increment,
										bug_id					int not null,
										device_id				int not null,
										status_id				int not null,
										PRIMARY KEY(bug_device_id),
										INDEX(bug_id),
										FOREIGN KEY (bug_id) REFERENCES bug (bug_id) ON UPDATE CASCADE ON DELETE CASCADE,
										INDEX(device_id),
										FOREIGN KEY (device_id) REFERENCES device (device_id) ON UPDATE CASCADE ON DELETE CASCADE,
										INDEX(status_id),
										FOREIGN KEY (status_id) REFERENCES status (status_id) ON UPDATE CASCADE ON DELETE CASCADE
										
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci						
								";
	if(mysql_query($sql_create_bug_device_dbo))
	{
		echo "<br/>Table bug_device created";
		//insert data
		$sql_insert = "INSERT INTO bug_device (bug_device_id,bug_id, device_id,status_id) VALUES 
																	(1,1,1,1),
																	(2,1,2,1),
																	(3,2,1,2),
																	(4,2,2,2),
																	(5,3,1,3),
																	(6,3,2,3),
																	(7,4,1,1),
																	(8,4,2,1),
																	(9,5,1,2),
																	(10,5,2,2),
																	(11,6,1,3),
																	(12,6,2,3),
																	(13,7,1,1),
																	(14,7,2,1),
																	(15,8,1,2),
																	(16,8,2,2),
																	(17,9,1,3),
																	(18,9,2,3),
																	(19,10,1,1),
																	(20,10,2,1),
																	(21,11,1,2),
																	(22,11,2,2),
																	(23,12,1,3),
																	(24,12,2,3),
																	(25,13,2,1),
																	(26,13,1,1),
																	(27,14,2,2),
																	(28,14,1,2),
																	(29,15,2,3),
																	(30,15,1,3)
																	
																	
																	
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert bug_device completed";
		}
		else
		{
			echo "<br/>Error Insert bug_device: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error();
	}
	*/
	//create table bug_tester
	$sql_create_bug_tester_dbo = "
									CREATE TABLE IF NOT EXISTS bug_tester
									(
										bug_tester_id 			int not null auto_increment,
										bug_id					int not null,
										tester_id				int not null,
										status_id				int not null,
										date_post				int not null,
										PRIMARY KEY(bug_tester_id),
										INDEX(bug_id),
										FOREIGN KEY (bug_id) REFERENCES bug (bug_id) ON UPDATE CASCADE ON DELETE CASCADE,
										INDEX(tester_id),
										FOREIGN KEY (tester_id) REFERENCES user_info (user_id) ON UPDATE CASCADE ON DELETE CASCADE,
										INDEX(status_id),
										FOREIGN KEY (status_id) REFERENCES status (status_id) ON UPDATE CASCADE ON DELETE CASCADE
										
										
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci						
								";
	if(mysql_query($sql_create_bug_tester_dbo))
	{
		echo "<br/>Table bug_device created";
		//insert data
		$sql_insert = "INSERT INTO bug_tester (bug_tester_id,bug_id, tester_id,status_id,date_post) VALUES 
																	(1,1,1,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(2,1,2,1,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(3,2,1,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(4,2,2,2,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(5,3,1,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(6,3,2,3,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(7,4,1,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(8,4,2,1,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(9,5,1,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(10,5,2,2,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(11,6,1,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(12,6,2,3,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(13,7,1,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(14,7,2,1,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(15,8,1,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(16,8,2,2,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(17,9,1,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(18,9,2,3,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(19,10,1,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(20,10,2,1,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(21,11,1,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(22,11,2,2,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(23,12,1,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(24,12,2,3,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(25,13,2,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(26,13,1,1,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(27,14,2,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(28,14,1,2,UNIX_TIMESTAMP ('2012-01-29 20:22:23')),
																	(29,15,2,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(30,15,1,3,UNIX_TIMESTAMP ('2012-01-29 20:22:23'))
																	
																	
																	
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert bug_tester completed";
		}
		else
		{
			echo "<br/>Error Insert bug_tester: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error();
	}
	
	//create table bug_fixer
	$sql_create_bug_fixer_dbo = "
									CREATE TABLE IF NOT EXISTS bug_fixer
									(
										bug_fixer_id 			int not null auto_increment,
										bug_id					int not null,
										fixer_id				int not null,
										status_id				int not null,
										date_post				int not null,
										PRIMARY KEY(bug_fixer_id),
										INDEX(bug_id),
										FOREIGN KEY (bug_id) REFERENCES bug (bug_id) ON UPDATE CASCADE ON DELETE CASCADE,
										INDEX(fixer_id),
										FOREIGN KEY (fixer_id) REFERENCES user_info (user_id) ON UPDATE CASCADE ON DELETE CASCADE,
										INDEX(status_id),
										FOREIGN KEY (status_id) REFERENCES status (status_id) ON UPDATE CASCADE ON DELETE CASCADE
										
										
										
									)ENGINE=INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci						
								";
	if(mysql_query($sql_create_bug_fixer_dbo))
	{
		echo "<br/>Table bug_fixer created";
		//insert data
		$sql_insert = "INSERT INTO bug_fixer (bug_fixer_id,bug_id, fixer_id,status_id,date_post) VALUES 
																	(1,1,1,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(2,1,2,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(3,2,1,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(4,2,2,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(5,3,1,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(6,3,2,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(7,4,1,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(8,4,2,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(9,5,1,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(10,5,2,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(11,6,1,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(12,6,2,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(13,7,1,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(14,7,2,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(15,8,1,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(16,8,2,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(17,9,1,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(18,9,2,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(19,10,1,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(20,10,2,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(21,11,1,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(22,11,2,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(23,12,1,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(24,12,2,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(25,13,2,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(26,13,1,1,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(27,14,2,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(28,14,1,2,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(29,15,2,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23')),
																	(30,15,1,3,UNIX_TIMESTAMP ('2012-01-30 20:22:23'))
																	
																	
																	
					";
		if(mysql_query($sql_insert))
		{
			echo "<br>Insert bug_fixer completed";
		}
		else
		{
			echo "<br/>Error Insert bug_fixer: " . mysql_error();
		}
	}
	else
	{
		echo "<br/>Error creating table: " . mysql_error();
	}
?>